<%-- 
    Document   : faq
    Created on : 8-jan-2013, 14:40:07
    Author     : Kaoutar Azagagh
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <link href="/style/student.css" type="text/css" rel="Stylesheet">
        <link href="/style/general.css" type="text/css" rel="Stylesheet">

        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>

        <!-- include jQuery UI  From Google Code-->
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>


        <script type="text/javascript">
            $(document).ready(function(){
                $("#menu a").hover(function() {
                    $(this).stop().animate({ backgroundColor: "#4e88b2"}, 800);
                },function() {
                    $(this).stop().animate({ backgroundColor: "#504e4e" }, 800);
                });
				
            }); 
        </script>
        <jsp:useBean id="inhoud" scope="application" class="models.Bean" />   
        <jsp:setProperty name="inhoud" property="language" value="<%= models.Bean.getLanguage()%>" />

        <title>
            Three 2 Learn | FAQ
        </title>

    </head>
    <body>

        <div id="wrapper">
            <div id="header">
                <div id="topmenu">
                    <ul class="login">
                        <li><img src="style/logo32L.png"/></li>
                        <li><a href="/language?lang=nl" title="Nederlands"><img src="images/flags/nl.png"></a></li>
                        <li><a href="/language?lang=en" title="English"><img src="images/flags/uk.png"></a></li>
                                <c:choose>
                                    <c:when test="${loggedin eq 'true'}">
                                <li><a href="/logout" id="toggleLogout" >
                                        <jsp:setProperty name="inhoud" property="key" value="LogOut" />
                                        <jsp:getProperty name="inhoud" property="key" />
                                    </a></li>
                                <li><a href="/${omgeving}" >
                                        <jsp:setProperty name="inhoud" property="key" value="BackTo" />
                                        <jsp:getProperty name="inhoud" property="key" /> ${omgeving}
                                        <jsp:setProperty name="inhoud" property="key" value="TheEnvironment" />
                                        <jsp:getProperty name="inhoud" property="key" />
                                    </a></li>
                                <li><h2><jsp:setProperty name="inhoud" property="key" value="Welcome" />
                                        <jsp:getProperty name="inhoud" property="key" />, ${user.firstName} ${user.lastName}</h2></li>
                                    </c:when>
                                    <c:otherwise>
                                <li><a href="#" id="toggleLogin" >
                                        <jsp:setProperty name="inhoud" property="key" value="Login" />
                                        <jsp:getProperty name="inhoud" property="key" />
                                    </a></li>
                                </c:otherwise>
                            </c:choose>                        
                    </ul>
                </div>
                <div class="middle">
                    <div id="menu">
                        <ul>
                            <li><a href="/index">
                                    <jsp:setProperty name="inhoud" property="key" value="Homepage" />
                                    <jsp:getProperty name="inhoud" property="key" />
                                </a></li>
                            <li><a href="/courses">
                                    <jsp:setProperty name="inhoud" property="key" value="Courses" />
                                    <jsp:getProperty name="inhoud" property="key" />
                                </a></li>

                            <li><a href="three2Learn.jsp">Three2Learn</a></li>
                            <li><a href="information.jsp">

                                    <jsp:setProperty name="inhoud" property="key" value="Information" />

                                    <jsp:getProperty name="inhoud" property="key" />
                                </a></li>
                            <li><a href="faq.jsp">

                                    <jsp:setProperty name="inhoud" property="key" value="FAQ" />
                                    <jsp:getProperty name="inhoud" property="key" />
                                </a></li>

                            <li><a href="contact.jsp" class="lastItem">Contact</a></li>
                        </ul>
                    </div>
                </div>
            </div>
            <div id="subcontainer">                    
                <div>
                    <h1>
                        <jsp:setProperty name="inhoud" property="key" value="FAQ" />
                        <jsp:getProperty name="inhoud" property="key" />
                    </h1>
                    <h3>
                        <jsp:setProperty name="inhoud" property="key" value="FAQIntro" />
                        <jsp:getProperty name="inhoud" property="key" /><br/>
                    </h3>
                    </p>
                    <br/>
                    <ul>
                        <c:set var="languageTest" value="<%= models.Bean.getLanguage()%>"/>
                        <c:choose>
                            <c:when test="${languageTest == 'nl'}">
                                <c:forEach var="faq" items="${faqs}">
                                    <li><b>
                                            ${faq.questionNL}
                                    </li></b>
                                    <ul>
                                        <li>
                                            <jsp:setProperty name="inhoud" property="key" value="Verwijderen" />
                                            <c:if test="${not empty admin}"><form method="post"><input type="hidden" name="questionID" value="${faq.FAQID}"/></c:if>
                                                ${faq.answerNL} <c:if test="${not empty admin}"><input type="submit" value="<jsp:getProperty name="inhoud" property="key" />"/></form></c:if>
                                            </li>
                                        </ul>
                                </c:forEach>
                            </c:when>
                            <c:otherwise>
                                <c:forEach var="faq" items="${faqs}">
                                    <li><b>
                                            ${faq.questionEN}
                                    </li></b>
                                    <ul>
                                        <li>
                                            <jsp:setProperty name="inhoud" property="key" value="Verwijderen" />
                                            <c:if test="${not empty admin}"><form method="post"><input type="hidden" name="questionID" value="${faq.FAQID}"/></c:if>
                                                ${faq.answerEN} <c:if test="${not empty admin}"><input type="submit" value="<jsp:getProperty name="inhoud" property="key" />"/></form></c:if>
                                            </li>
                                        </ul>
                                </c:forEach>
                            </c:otherwise>
                                    </c:choose>
                        </ul>
                        <c:if test="${not empty admin}">
                            <br/>
                            <form action="/addfaq">

                                <jsp:setProperty name="inhoud" property="key" value="AddQuestion" />
                                <a href="/addfaq"><jsp:getProperty name="inhoud" property="key" /></a>
                            </form>
                        </c:if>
                    </div>



                </div>
            </div>

        </body>
    </html>

